package threading;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2023-03-15
 * Time: 20:01
 */
public class ThreadDemo8 {
    public static void main(String[] args) {
        Thread t=new Thread(()->{
            while(true){

            }
        });
        t.setDaemon(true);//将值改为true,变为后台进程,不阻止线程结束
        t.start();

       //此时默认创建的线程是前台线程,阻止线程结束
    }
}
